﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Collections.Generic;
using System.Web.Mvc;

namespace HashFooRest.App.Web.Config
{
    public class SingletonTestFilter : FilterAttribute, IActionFilter
    {
        int _invokeCount;

        /// <summary>
        /// Called before an action method executes.
        /// </summary>
        /// <param name="filterContext">The filter context.</param>
        public void OnActionExecuting(ActionExecutingContext filterContext)
        {
            _invokeCount++;
            Debug.WriteLine("Singleton Test Filter Invoke Count: " + _invokeCount);
        }

        /// <summary>
        /// Called after the action method executes.
        /// </summary>
        /// <param name="filterContext">The filter context.</param>
        public void OnActionExecuted(ActionExecutedContext filterContext)
        {
        }
    }
}